//
//  EMImageScrollView.h
//  EMImagePageViewDemo
//
//  Created by fortsven on 14/12/31.
//  Copyright (c) 2014年 hoperun. All rights reserved.
//
#import <UIKit/UIKit.h>

@protocol EMImageScrollViewDelegate;
@protocol EMImageScrollViewDatasource;

@interface EMImageScrollView : UIView<UIScrollViewDelegate>
{
    UIScrollView *_scrollView;
    UIPageControl *_pageControl;
    
    NSInteger _totalPages;
    NSInteger _curPage;
    
    NSMutableArray *_curViews;
}

@property (nonatomic,readonly) UIScrollView *scrollView;
@property (nonatomic,readonly) UIPageControl *pageControl;
@property (nonatomic,assign) NSInteger currentPage;
@property (nonatomic,assign,setter = setDataource:) id<EMImageScrollViewDatasource> datasource;
@property (nonatomic,assign,setter = setDelegate:) id<EMImageScrollViewDelegate> delegate;

- (void)reloadData;
- (void)setViewContent:(UIView *)view atIndex:(NSInteger)index;

@end

@protocol EMImageScrollViewDelegate <NSObject>

@optional
- (void)didClickPage:(EMImageScrollView *)csView atIndex:(NSInteger)index;

@end

@protocol EMImageScrollViewDatasource <NSObject>

@required
- (NSInteger)numberOfPages;
- (UIView *)pageAtIndex:(NSInteger)index;

@end
